import Vue from 'vue'
import App from './App.vue';

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);


// 引入路由文件
import router from './router'
// Vue.config.productionTip = false


// 网络请求
import axio from './http/http.js'
Vue.prototype.$http = axio


// 路由拦截判断
router.afterEach((to, from, next) => {
	// 如果路由不一样，滚动到最顶部
	if (to.name != from.name) {
		window.scrollTo(0, 0);
	}
	if (to.meta.title) {
		document.title = to.meta.title || '社会帮扶';
	}
	// next();
})

new Vue({
	beforeCreate() {
		Vue.prototype.$bus = this
	},
	router,
	render: h => h(App),
}).$mount('#app')
